/*
 * JDiskHogApp.java
 */

package jdiskhog;

import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;

/**
 * The main class of the application.
 */
public class JDiskHogApp extends SingleFrameApplication {

    /**
     * At startup create and show the main frame of the application.
     */
    @Override protected void startup() {
        show(new JDiskHogView(this));
    }

    /**
     * This method is to initialize the specified window by injecting resources.
     * Windows shown in our application come fully initialized from the GUI
     * builder, so this additional configuration is not needed.
     */
    @Override protected void configureWindow(java.awt.Window root) {
    }

    
    private DiskUsageModel diskUsageModel= new DiskUsageModel();

    public static final String PROP_DISKUSAGEMODEL = "diskUsageModel";

    /**
     * Get the value of diskUsageModel
     *
     * @return the value of diskUsageModel
     */
    public DiskUsageModel getDiskUsageModel() {
        return this.diskUsageModel;
    }

    /**
     * Set the value of diskUsageModel
     *
     * @param newdiskUsageModel new value of diskUsageModel
     */
    public void setDiskUsageModel(DiskUsageModel newdiskUsageModel) {
        DiskUsageModel olddiskUsageModel = diskUsageModel;
        this.diskUsageModel = newdiskUsageModel;
        propertyChangeSupport.firePropertyChange(PROP_DISKUSAGEMODEL, olddiskUsageModel, newdiskUsageModel);
    }

    private java.beans.PropertyChangeSupport propertyChangeSupport = new java.beans.PropertyChangeSupport(this);

    /**
     * Add PropertyChangeListener.
     *
     * @param listener
     */
    public void addPropertyChangeListener(java.beans.PropertyChangeListener listener )
    {
        propertyChangeSupport.addPropertyChangeListener( listener );
    }

    /**
     * Remove PropertyChangeListener.
     *
     * @param listener
     */
    public void removePropertyChangeListener(java.beans.PropertyChangeListener listener )
    {
        propertyChangeSupport.removePropertyChangeListener( listener );
    }

    /**
     * A convenient static getter for the application instance.
     * @return the instance of JDiskHogApp
     */
    public static JDiskHogApp getApplication() {
        return Application.getInstance(JDiskHogApp.class);
    }

    /**
     * Main method launching the application.
     */
    public static void main(String[] args) {
        launch(JDiskHogApp.class, args);
    }
}
